package com.dl.controller;

import com.dl.pojo.Order;
import com.dl.response.CommonResult;
import com.dl.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping(value="/order/create")
    public CommonResult<String> create(Order order){
        int result = orderService.create(order);
        if(result>0){
            return CommonResult.createBySuccessMsg("订单交易成功！",null);
        }else{
            return CommonResult.createByErrorMsg("订单交易失败！",null);
        }
    }
}
